
Vue.component2('a_1_0_2_23_1', {  
    template: `
        <div  :class="{ 'a_1_0_2_23_1_lines test': data.true, 'a_1_0_2_23_1_lines_onclick': data.onclick_flag }" @click="handle_click" v-show="show_flag">
        <span :style="'padding-left: '+data._space_+'px;'"></span>
        <span  v-if="data.icon1_show_flag":class="{'icon iconfont':data.true,'icon-right':data.close,'icon-down':data.close==false}"></span>
        
        <span class="a_1_0_2_23_1_hid_line"  style="color:#bcbcbc">{{data.name}}</span>
        <div style="display:inline-block;flex:1;">
        <div style="display:flex;
    justify-content: flex-end;
    display: flex;">
    
        <div  @click="click1($event,k)" v-for="(v,k) in data.icon_data"
        :key="k">
         <a_1_0_3_0_0 style="display: inline-block;"
         :deepcopy_data="v"></a_1_0_3_0_0>
        </div>
        </div>
        </div>



















        </div>
`,
data(){
    return{
        show_flag:true,
        data:{
            onclick_flag:false,
            tree_data:{},//
            icon_data:{},
            icon1_show_flag:true,
            click:null,
            click_obj:null,
            true:true,
            recv_data:null,
            false:false,
            close:true,
            name:"",
            _space_:0,
        }
    }
},
methods:{
    handle_click:async function(event){
        //点击当前 高亮显示
        try{//console.log("高亮",this.data.path);
this.data.tree_data.set_onclick_flag(this.data.path)}catch{}
        // /* console.log("我点击了一次")*/
        try{
            // if(!this.data.recv_data){
                // await this.data.刷新();
            // }
            
        
            /*console.log("?2")*/}
        catch{}

        if (this.data.click){
            try{
                this.data.click(event)
            
                // console.log("start click2")
            }
            catch{}
            return 
        }


        if (this.data.click_obj){
            try{
                lhp_run_func(this.data.click_obj.func,this.data.click_obj.args)
            
                // console.log("start click3")
            }
            catch{}
            return 
        }
        try{
            this.data.click_handle(this.data.path,this.data.close);
        }catch{}
    },
    click1:async function(event,k){
       /* console.log(',,,',this.data.icon_data[k].click)*/
        lhp_run_func(this.data.icon_data[k].click);
        if(!this.data.click_stop){event.stopPropagation();}//阻止父级

    }
},

mounted:function(){
    let urls=_this.deepcopy_data.tree_data.url;
_this.data.粘贴前端目录2_request=request______({method:'post',url:urls.粘贴前端目录2_url});
//通过路由获取当前项目  所在的 用户id  项目目录  项目id
let getQueryParams=function () {  
    const queryParams = {};  
    const urlParams = new URLSearchParams(window.location.search);  
    for (const [key, value] of urlParams.entries()) {  
        queryParams[key] = value;  
    }  
    return queryParams;  
}  

let params=getQueryParams();

_this.data.icon_data={
    198:{

    icon_class:"icon iconfont icon-zhantie",
    hovertext:"粘贴目录2",
    add_show:false,
    click:async function(){
        

        try {
            let text = await navigator.clipboard.readText();
            if(text.split("_").length!=4){
                _this.$message({
                    type: 'error',
                    message: '数据格式不符合a_xx_xx_xx'
                  });      
                return
            }
            console.log('粘贴板中的文本: ' + text);
            let par=JSON.parse(JSON.stringify(params));
            par.text=text;
            par.key=_this.data.path;
            _this.data.粘贴前端目录2_request({
                body_data:par,
            });
          } catch (err) {
            
            _this.$message({
                type: 'error',
                message: '无法读取粘贴板内容:'  + err.message
              });      
          }
        
        },
    },
    199:{

    icon_class:"icon iconfont icon-add_dir2",
    hovertext:"新建目录2",
    click:async function(){
        _this.$prompt('新建目录2名称', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
          }).then(({ value }) => {
            try{ if(!_this.data.dir1_id){
                let path_lst=_this.data.path.split(".");
                console.log("###############path_lst",_this.data.path,path_lst,path_lst[1])
                _this.data.dir1_id=path_lst[1];
            }
              let update_val={
              "type":"change_data",
              "data_type":"set_list",
              "update_params":[
              
                          {
                          "name":'@add_index',
                          "path":`page_config.dict.2.dict.${_this.data.dir1_id}.base_info.index`,
                          "use":"++s"
                          }
              ],
              "postput":[
              {
                  'path':`page_config.dict.2.dict.${_this.data.dir1_id}.dict.@add_index`,
                  'data':{"base_info": {
                    "vue_name":"a_1_0_2_20_1",
                    "index": 0,
                    "deepcopy_data": {
                        "name":value
                    }
                },
                "dict": {
                }}
              },
              {
                  'path':`page_config.dict.2.dict.${_this.data.dir1_id}.base_info`,
                  'data':{"index":"@add_index"}
              },
              ],
              }
            _this.data.tree_data.全局配置对象.更新(update_val);

            }catch (err){console.log("err",err);
}
           
          }
        
        
        
        ).catch(() => {
            _this.$message({
              type: 'info',
              message: '取消输入'
            });       
          });},
    },
}


}

})